<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="EditPlugins.aspx.cs" Inherits="Impact.Web.Admin.EditPlugins" EnableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <table class="AdminTable">
    
        <tr>
            <th colspan="2"><asp:Label ID="title" runat="server" /></th>
            <th class="NonHeader">Order</th>
            <th class="NonHeader">Parameters</th>
            <th class="NonHeader">Delete</th>
        </tr>

        <tr>
            <td>
                <asp:Repeater ID="pluginsRepeater" OnItemDataBound="pluginsRepeater_ItemDataBound" runat="server">
                    <ItemTemplate>
                        <tr>
                            <td style=" text-align: left; font-weight: bold;">
                                <asp:HiddenField ID="registrationId" Value='<%# Eval("RegistrationId") %>' runat="server" />
                                <asp:HiddenField ID="pluginId" Value='<%# Eval("PluginId") %>' runat="server" />
                                <%# Eval("Plugin.Name") %>
                            </td>
                            <td style="text-align: left;">
                                Location: 
                                <asp:DropDownList ID="location" AutoPostBack="true" OnSelectedIndexChanged="Location_Changed"
                                    runat="server">
                                    <asp:ListItem>1</asp:ListItem>
                                    <asp:ListItem>2</asp:ListItem>
                                    <asp:ListItem>3</asp:ListItem>
                                    <asp:ListItem>4</asp:ListItem>
                                    <asp:ListItem>5</asp:ListItem>
                                    <asp:ListItem>6</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td style="text-align: center;">
                                <asp:ImageButton ID="upButton" ImageUrl="images/arrow_up.png"
                                    OnCommand="Up_Command" CommandArgument='<%# Eval("RegistrationId") %>' runat="server" />
                                <asp:ImageButton ID="downButton" ImageUrl="images/arrow_down.png"
                                    OnCommand="Down_Command" CommandArgument='<%# Eval("RegistrationId") %>'  runat="server" />
                            </td>
                            
                            <td style="text-align: center;">
                                <asp:ImageButton ID="parameterButton" ImageUrl="images/cog.png" AlternateText="Edit Parameters"
                                    OnCommand="Parameter_Command" CommandArgument='<%# Eval("RegistrationId") %>' runat="server" />
                            </td>
                                    
                            <td style="text-align: center;">
                                <asp:ImageButton ID="deleteButton" OnCommand="Delete_Command"  CommandArgument='<%# Eval("RegistrationId") %>' 
                                    ImageUrl="images/red-x.png" runat="server" />
                            </td>
                        </tr>
                        
                        
                        <tr>
                            <td colspan="5"><hr /></td>
                        </tr>
                    
                    </ItemTemplate>
                </asp:Repeater>
            </td>
        </tr>
        
        <tr>
            <td colspan="5" style=" vertical-align: middle; text-align: right;"><asp:Image ID="addImage" ImageUrl="images/add.png" runat="server" />
                Add Plugin:
                <asp:DropDownList ID="addPlugin" AppendDataBoundItems="true" AutoPostBack="true" runat="server" 
                    OnSelectedIndexChanged="AddPlugin">
                    <asp:ListItem Text="Select a plugin..." />
                </asp:DropDownList>
            </td>
        </tr>

        <tr>
            <td colspan="5" style="text-align: center;">
                <impact:ImageLinkButton ID="okButton" ImageUrl="images/accept.png" Text="Ok" CssClass="AdminTableButton"
                    OnCommand="Ok_Command" runat="server" />
            </td>
        </tr>

    </table>

</asp:Content>
